<?php
class LDatabase{
	public $host;
	public $user;
	public $pass;
	public $database;
	public $mysqli;
	public $query;
	public $from;
	public $where;
	public $limit;
	
	public function __construct($_host,$_user,$_pass,$_database){
		$this->host = $_host;
		$this->user = $_user;
		$this->pass = $_pass;
		$this->database = $_database;
	}
	
	public function getDBO(){
		$this->mysqli = new mysqli($this->host, $this->user, $this->pass, $this->database);
		if ($this->mysqli->connect_errno) {
			printf("Connect database failed: %s\n", $this->mysqli->connect_error);
			exit();
		}
	}
	
	public function execute(){
		$results = null;
		if(isset($this->where) && $this->where != null)
		{
			$this->query .= 'WHERE'.$this->where;
		}
	}
	
	public function closeDB(){
		$this->mysqli->close();
	}
}